package com.anda.jsu.yangsp.core.sys.mail.bean;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * 邮件信息认证器
 * 
 * @author xiaolu
 * @since 2012-12-06
 * 
 */
public class AndaAuthenticatorBean extends Authenticator {

	private String userName;
	private String securityWord;

	public AndaAuthenticatorBean() {
	}

	public AndaAuthenticatorBean(String userName, String securityWord) {
		this.userName = userName;
		this.securityWord = securityWord;
	}

	/**
	 * 此处必须使用getter方法,即为重载
	 */
	@Override
	protected PasswordAuthentication getPasswordAuthentication() {
		return new PasswordAuthentication(userName, securityWord);
	}

}
